package cn.onlineoedering.user.service.impl;

import java.util.List;

import cn.onlineoedering.user.dao.UserDao;
import cn.onlineoedering.user.dao.impl.UserDaoImpl;
import cn.onlineoedering.user.entity.GeneralUser;
import cn.onlineoedering.user.service.UserService;

public class UserserviceImpl implements UserService {
	
	private UserDao userDao =new UserDaoImpl();
	
	public void save(GeneralUser generalUser) {
		userDao.save(generalUser);
	}

	public GeneralUser queryByName(String name) {
		return userDao.queryByName(name);
	}
	
	public List<GeneralUser> queryAll() {
		List<GeneralUser> users=userDao.queryAll();
		return users ;
	}
	
	public void delete(long id) {
		userDao.delete(id);
	}
	
	public void update(GeneralUser generalUser) {
		userDao.update(generalUser);
	}
	
	public void saveToXml(GeneralUser user) {
		String path="D:\\user.xml";
		userDao.saveTOXml(user, path);
	}

}
